package org.app
package service

import dao.UserDAO

import org.app.models.UserModel

class UserService {
  private val userDAO= new UserDAO()
  // 身份校验
  def authenticateUser(username: String, password: String): Option[UserModel] = {
    // 去根据用户名和密码查询，是否有符合要求的用户
    val users = userDAO.loadUsers()
    users.find(user => user.username == username && user.password == password)
  }
}
